package wli.java.file.util;

import java.net.*;

public class FileStructure implements java.io.Serializable,
		Comparable<FileStructure> {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int id;
	private int pid;
	private String ufid;
	private String path;
	private String name;
	private URI url;
	private boolean isFile;
	private boolean disply_on;
	private boolean status; // show folder open or close
	private boolean hasChildren;

	public FileStructure() {
		// TODO Auto-generated constructor stub
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getId() {
		return id;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public String getPath() {
		return path;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setUrl(URI url) {
		this.url = url;
	}

	public URI getUrl() {
		return url;
	}

	public boolean isFile() {
		return this.isFile;
	}

	public void setIsFile(boolean isfile) {
		this.isFile = isfile;
	}

	public boolean isDisplyOn() {
		return disply_on;
	}

	public void setDisplyOn(boolean disply_on) {
		this.disply_on = disply_on;
	}

	public int getPid() {
		return pid;
	}

	public void setPid(int pid) {
		this.pid = pid;
	}

	public int compareTo(FileStructure other) {
		if (!(other instanceof FileStructure)) {
			throw new ClassCastException("Invalid object");
		}
		System.out.println("AAAA>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
				+ other.getPath() + "\\" + other.name);
		System.out.println("BBBB>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" + this.getPath()
				+ "\\" + this.name);
		return 0-(path).compareTo(other.getPath());
	}

	public boolean hasChildren() {
		return hasChildren;
	}

	public void setHasChildren(boolean hasChildren) {
		this.hasChildren = hasChildren;
	}

	public String getUfid() {
		return ufid;
	}

	public void setUfid(String ufid) {
		this.ufid = ufid;
	}

	public boolean isOpen() {
		return status;
	}

	public void setIsOpen(boolean status) {
		this.status = status;
	}

}
